<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
  <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
  <script type="text/javascript" th:src="@{/js/jquery-1.12.4.js}"></script>
</head>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>数据统计</li>
    <li>客户销量统计</li>
    <li>销量详情</li>
  </ul>
</div>
<div class="rightinfo">
  <form id="form" th:action="@{/market/order/findBydDelivery}" method="post">
    <input type="hidden" id="pageNum" name="pageNum"/>
    <input type="hidden" th:value="${customid}" name="customid"/>
    <table class="tablelist">
      <thead>
        <tr>
          <th>序号</th>
          <th>客户姓名</th>
          <th>订购单编号</th>
          <th>商品数量</th>
          <th>金额</th>
          <th>订购时间</th>
          <th>操作人</th>
          <th>订购单详情</th>
        </tr>
      </thead>
      <tbody>
        <tr th:each="od,i :${odpb.list}">
          <td th:text="${(odpb.pageNum-1)*odpb.pageSize+i.count}">1</td>
          <td th:text="${od.order.custom.customname}">王金平</td>
          <td th:text="${od.orderId}">DJ201701270001</td>
          <td th:text="${od.totality}">5</td>
          <td th:text="'￥'+${od.totalMoney}+'万'">￥76,582</td>
          <td th:text="${od.order.ordertime}">2017-01-25 15:05:05</td>
          <td th:text="${od.order.operatorUser.uname}">马云</td>
          <td>
          	<a th:href="@{'/market/order/findByDetails?orderid='+${od.orderId}}" class="tablelink">查看详情</a>
          </td>
        </tr>
      </tbody>
    </table>
    <div class="pagin">
      <div class="message">共<i class="blue" th:text="${odpb.total}">1256</i>条记录，当前显示第&nbsp;<i class="blue"
                                                                                              th:text="${odpb.pageNum}">2&nbsp;</i>页
      </div>
      <ul class="paginList">
        <li class="paginItem">
          <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${odpb.isFirstPage?1:odpb.pageNum-1}]])">
            <span th:class="${odpb.isFirstPage?'pagepre':'pagenxt roate'}"></span>
          </a>
        </li>

        <li class="paginItem" th:if="${1+4<=odpb.pageNum}"><a th:onclick="tiaoZhuan(1)"
                                                              href="javascript:void(0);">1</a></li>
        <li class="paginItem more" th:if="${1+5<=odpb.pageNum}"><a href="javascript:void(0);">...</a></li>
        <li class="paginItem" th:if="${1+3<=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum-3}]])"
                                                              href="javascript:void(0);"
                                                              th:text="${odpb.pageNum-3}">3</a></li>
        <li class="paginItem" th:if="${1+2<=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum-2}]])"
                                                              href="javascript:void(0);"
                                                              th:text="${odpb.pageNum-2}">4</a></li>
        <li class="paginItem" th:if="${1+1<=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum-1}]])"
                                                              href="javascript:void(0);"
                                                              th:text="${odpb.pageNum-1}">1</a></li>

        <li class="paginItem current"><a href="javascript:void(0);" th:text="${odpb.pageNum}">2</a></li>

        <li class="paginItem" th:if="${odpb.pages-1>=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum+1}]])"
                                                                       href="javascript:void(0);"
                                                                       th:text="${odpb.pageNum+1}">3</a></li>
        <li class="paginItem" th:if="${odpb.pages-2>=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum+2}]])"
                                                                       href="javascript:void(0);"
                                                                       th:text="${odpb.pageNum+2}">4</a></li>
        <li class="paginItem" th:if="${odpb.pages-3>=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pageNum+3}]])"
                                                                       href="javascript:void(0);"
                                                                       th:text="${odpb.pageNum+3}">5</a></li>
        <li class="paginItem more" th:if="${odpb.pages-5>=odpb.pageNum}"><a href="javascript:void(0);">...</a></li>
        <li class="paginItem" th:if="${odpb.pages-4>=odpb.pageNum}"><a th:onclick="tiaoZhuan([[${odpb.pages}]])"
                                                                       href="javascript:void(0);"
                                                                       th:text="${odpb.pages}">10</a></li>

        <li class="paginItem">
          <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${odpb.isLastPage?odpb.pages:odpb.pageNum+1}]])">
            <span th:class="${odpb.isLastPage?'pagepre roate ':'pagenxt '}"></span>
          </a>
        </li>
      </ul>
    </div>
  </form>
  <script>
    function tiaoZhuan(pageNum) {
      $("#pageNum").val(pageNum);
      $("#form").submit();
    }
  </script>
</div>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
